package com.seatiger.structure.segmentTree;

/**
 *
 */
public class SegmentTreeMain {
    public static void main(String[] args) {
        Integer[] nums = {-2, 0, 3, -5, 2, -1};
        SegmentTree segmentTree =
                new SegmentTree<>(nums, (num1, num2) -> num1 + num2);
        System.out.println(segmentTree);
        System.out.println(segmentTree.query(0,2));
        System.out.println(segmentTree.query(2,5));
        System.out.println(segmentTree.query(0,5));
    }
}
